From 81211692d611f01f03474e417212b7ee5fa06d34 Mon Sep 17 00:00:00 2001 From: alexmot Date: Wed, 6 Aug 2003 14:13:17 +0000 Subject: [PATCH] (route #0 bug) enforce sequential route numbers when writing route output. --- gpsbabel/magproto.c | 8 ++++++-- gpsbabel/reference/route/magellan.rte | 16 ++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gpsbabel/magproto.c b/gpsbabel/magproto.c index 0d191a99f..888c47ff0 100644 --- a/gpsbabel/magproto.c +++ b/gpsbabel/magproto.c @@ -43,7 +43,7 @@ static void *mkshort_handle; static char *deficon; static char *bs; static char *noack; - +static int route_out_count; typedef enum { mrs_handoff = 0, @@ -1274,6 +1274,9 @@ mag_route_trl(const route_head * rte) /* number of output PMGNRTE messages at 2 points per line */ numlines = (i / 2) + (i % 2); + /* increment the route counter. */ + route_out_count++; + thisline = i = 0; QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) { waypointp = (waypoint *) elem; @@ -1295,7 +1298,7 @@ mag_route_trl(const route_head * rte) thisline++; sprintf(obuff, "PMGNRTE,%d,%d,c,%d,%s,%s", - numlines, thisline, rte->rte_num, + numlines, thisline, route_out_count, buff1, buff2); mag_writemsg(obuff); @@ -1314,6 +1317,7 @@ mag_route_hdr(const route_head *rh) static void mag_route_pr() { + route_out_count = 0; route_disp_all(mag_route_hdr, mag_route_trl, mag_waypt_pr); } diff --git a/gpsbabel/reference/route/magellan.rte b/gpsbabel/reference/route/magellan.rte index d7b9b55d1..6ded2831b 100644 --- a/gpsbabel/reference/route/magellan.rte +++ b/gpsbabel/reference/route/magellan.rte @@ -9,14 +9,14 @@ $PMGNWPL,2424.000,N,08824.000,W,0000000,M,43A,,a*06 $PMGNWPL,2336.000,N,08712.000,W,0000000,M,42A,,a*09 $PMGNWPL,2300.000,N,08536.000,W,0000000,M,41A,,a*0B $PMGNWPL,2218.000,N,08424.000,W,0000000,M,40A,,a*00 -$PMGNRTE,6,1,c,0,49B,a,49A,a*00 -$PMGNRTE,6,2,c,0,48B,a,48A,a*03 -$PMGNRTE,6,3,c,0,47B,a,47A,a*02 -$PMGNRTE,6,4,c,0,46A,a,43A,a*03 -$PMGNRTE,6,5,c,0,42A,a,41A,a*04 -$PMGNRTE,6,6,c,0,40A,a,*0C +$PMGNRTE,6,1,c,1,49B,a,49A,a*01 +$PMGNRTE,6,2,c,1,48B,a,48A,a*02 +$PMGNRTE,6,3,c,1,47B,a,47A,a*03 +$PMGNRTE,6,4,c,1,46A,a,43A,a*02 +$PMGNRTE,6,5,c,1,42A,a,41A,a*05 +$PMGNRTE,6,6,c,1,40A,a,*0D $PMGNWPL,3016.831,N,09141.153,W,0000000,M,ATLAUN,Launch at Butte LaRose,i*15 $PMGNWPL,3017.463,N,09137.630,W,0000000,M,ATWRNC,Canal to Warner Lake,k*38 $PMGNWPL,3018.883,N,09138.767,W,0000000,M,ATWRNR,Warner Lake,a*78 -$PMGNRTE,2,1,c,1,ATLAUN,i,ATWRNC,k*1A -$PMGNRTE,2,2,c,1,ATWRNR,a,*44 +$PMGNRTE,2,1,c,2,ATLAUN,i,ATWRNC,k*19 +$PMGNRTE,2,2,c,2,ATWRNR,a,*47 -- 2.30.2